import type { RouteRecordRaw } from 'vue-router';

import { $t } from '#/locales';

const routes: RouteRecordRaw[] = [
  {
    meta: {
      icon: 'lsicon:order-outline',
      keepAlive: true,
      order: 1,
      title: $t('order.title'),
    },
    name: 'order',
    path: '/order',
    children: [
      {
        meta: {
          title: $t('order.list'),
          affixTab: true,
        },
        name: 'orderList',
        path: '/order/list',
        component: () => import('#/views/order/index.vue'),
      },
      {
        meta: {
          title: $t('order.detail'),
          hideInMenu: true,
        },
        name: 'orderDetail',
        path: '/order/detail/:id?',
        component: () => import('#/views/order/orderDetail.vue'),
      },
      {
        meta: {
          title: $t('order.refundRecordList'),
        },
        name: 'refundRecordList',
        path: '/order/refundRecordList',
        component: () => import('#/views/order/refundRecordList.vue'),
      },
      {
        meta: {
          title: $t('order.writeoffRecordList'),
        },
        name: 'writeoffRecordList',
        path: '/order/writeoffRecordList',
        component: () => import('#/views/order/writeoffRecordList.vue'),
      },
    ],
  },
];

export default routes;
